	$(document).ready(
			function(){
				$(".complatefindbra").on("click", function() {
						var _this = $(this),
							_prev = _this.prev();
						if(_prev.hasClass("close")) {
							_prev.removeClass("close");
						} else {
							_prev.addClass("close");
						}
					});
						}
		);
	function winoptn(par){
		
       var nujcode = par;
       
       var nujvalue = $("tr[nujian="+nujcode+"]").attr("nujvalue");
	if(nujvalue == "1"){//2 是显示
	$("tr[nujian="+nujcode+"]").attr("nujvalue","2");
	} else {
	$("tr[nujian="+nujcode+"]").attr("nujvalue","1");
	}
 		var newnujvalue = $("tr[nujian="+nujcode+"]").attr("nujvalue");
       if(newnujvalue == "2"){//2 是显示
           $("tr[zijian="+"zijian"+"]").each(function(index, obj){
              var zijianvlue = $(obj).attr("zijianvlue");
              var newzijianvlue = zijianvlue.substring(0,4);
             
           if(nujcode == newzijianvlue){
               //obj.show();
               $(obj).css({ 'display': '' });
             //  $("."+brother).addClass("close");
             //$("#complatefindbra").prev().addClass("close");
            // $("."+$("#complatefindbra").prev().attr("class")).addClass("close");
           //  $(".complate_add").addClass("close");
           } 
           });
       } else {// 1是隐藏
           $("tr[zijian="+"zijian"+"]").each(function(index, obj){
              var zijianvlue = $(obj).attr("zijianvlue");
              var newzijianvlue = zijianvlue.substring(0,4);
           if(nujcode == newzijianvlue){
              $(obj).hide();
            //$(".complate_add").removeClass("close");
            // $("#complatefindbra").prev().removeClass("close");
           } 
           });
       }
       
    }
			
	function winopt(par,Aobj){
       var nujcode = par;
       var nujvalue = $("tr[nujian="+nujcode+"]").attr("nujvalue");
	if(nujvalue == "1"){//2 是显示
	$("tr[nujian="+nujcode+"]").attr("nujvalue","2");
	} else {
	$("tr[nujian="+nujcode+"]").attr("nujvalue","1");
	}
 		var newnujvalue = $("tr[nujian="+nujcode+"]").attr("nujvalue");
       if(newnujvalue == "2"){//2 是显示
           $("tr[zijian="+"zijian"+"]").each(function(index, obj){
              var zijianvlue = $(obj).attr("zijianvlue");
              var newzijianvlue = zijianvlue.substring(0,4);
             
           if(nujcode == newzijianvlue){
               //obj.show();
               $(obj).css({ 'display': '' });
               $(Aobj).addClass("close");
           } 
           });
       } else {// 1是隐藏
           $("tr[zijian="+"zijian"+"]").each(function(index, obj){
              var zijianvlue = $(obj).attr("zijianvlue");
              var newzijianvlue = zijianvlue.substring(0,4);
           if(nujcode == newzijianvlue){
              $(obj).hide();
              $(Aobj).removeClass("close");
           } 
           });
       }
    }

	function createXmlHttp(){
    	if (window.XMLHttpRequest) {
       		xmlHttp = new XMLHttpRequest();               
    	} else {
       		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    	}
	}
	
	
	
	//快速保存一个澄清答疑信息
	function releaseqAjax(){
		//前台校验
		if(toAccountSecond <= 0){
			//showMsg(getLanMsg("0ec22211-000057"));
			$("#later").show();
			return;
		}
		var pk_org = document.getElementById("pk_org_cal").value;
		var pk_group = document.getElementById("pk_group_cal").value;
		createXmlHttp();
		var pk_release_h = document.getElementById("pk_release_h").value;
		var questiontitle = document.getElementById("questiontitle").value;
		var questiondescribe = document.getElementById("questiondescribe").value;
		var opinion = document.getElementById("opinion").value;
		var pk_pur_project = document.getElementById("pk_pur_project").value;
		var pk_purproj_step = document.getElementById("pk_purproj_step").value;
		var type = document.getElementById("type").value;
		 
		
		if(questiontitle.length==0){
			alert("疑问标题不能为空");//以后抽取多语
			return false; 
		}
		if(questiondescribe.length==0){
			alert("疑问内容不能为空");//以后抽取多语
			return false; 
		}

		var postdata= ebvpContext+"/sourcing/biddingprojlist/addReleaseqa?questiontitle="+encodeURI(encodeURI(questiontitle))+"&pk_release_h="+encodeURI(encodeURI(pk_release_h))+"&questiondescribe="+encodeURI(encodeURI(questiondescribe));
		postdata+="&pk_pur_project="+pk_pur_project+"&pk_org="+pk_org+"&pk_group="+pk_group+"&pk_purproj_step="+pk_purproj_step;
	 

		if(opinion==1){
			var all_path = document.getElementById("all_path").value;
			var qafile_name = document.getElementById("qafile_name").value;
			var file_size = document.getElementById("file_size").value;
			var real_path = document.getElementById("real_path").value;
			xmlHttp.open("POST", ebvpContext+"/sourcing/biddingprojlist/addReleaseqa?questiontitle="+encodeURI(encodeURI(questiontitle))+"&pk_release_h="+encodeURI(encodeURI(pk_release_h))+"&questiondescribe="+encodeURI(encodeURI(questiondescribe))+"&qafile_name="+encodeURI(encodeURI(qafile_name))+"&all_path="+encodeURI(encodeURI(all_path))+"&file_size="+encodeURI(encodeURI(file_size))+"&opinion="+encodeURI(encodeURI(opinion))+"&pk_org="+pk_org+"&pk_group="+pk_group+"&pk_pur_project="+pk_pur_project+"&pk_purproj_step="+pk_purproj_step+"&type="+type,false); 
		}
		else {
			xmlHttp.open("POST", postdata,false); 
		}
		xmlHttp.setRequestHeader("If-Modified-Since","0");  
		xmlHttp.send(null);
		
		
			 
//			document.theform.action=ebvpContext+"/ebvpfile/addReleaseqa";
			//提交表单
//			var options3 = {
				
//				success : $("#massage").show()
//				};
//			$('#theform').ajaxSubmit(options3);
		
		$("#qafile_name").attr("value","");
		$("#real_path").attr("value","");
		$("#questiontitle").attr("value","");
		$("#questiondescribe").attr("value","");
		$("#all_path").attr("value","");
		$("#opinion").attr("value","");
		$("#massage").show();
		$("#imger").hide();
		$("#fujian").hide();
		$(".words").show();
		
		}
		
		//上传文件
		function uploadMyFile(){
			if (isClientCa == "true") {
				var strSn = getSN(strUserCode);
				if(strSn == null || strSn == ""){
					showMsg(getLanMsg("0ec22211-000058"));
					return;
				}
			}
			if(toAccountSecond <= 0){
			//showMsg(getLanMsg("0ec22211-000057"));
				$("#later").show();
				return;
			}
			//document.getElementById("opinion").value=1;
			var url = ebvpContext+"/sourcingcoll/FileUpload_new.jsp";
			url = url + "?" + "uploadMode=" + type;
			url = url + "&" + "userCode="+strUserCode;
			//url = url + "&" + "pkReleaseFileB="+pk_accessory;
			url = url + "&" + "isNeedAddRow=Y";
			var iTop = (window.screen.availHeight-30-330)/2;
			var iLeft = (window.screen.availWidth-10-620)/2;
			window.open(url,'' ,'width=620,height=330,location=no'+',top='+iTop+',left='+iLeft);
		}  

	
    $(document).ready(
			function(){
				//基本信息
				 $( "#managementAdd" ).click(function() {
			         $("#base").text();
				     $( "#managementInfo:visible" ).slideUp( function (){
				     $( this ).removeClass("hidden"); $(".management_add").addClass("close");$("#base").show();
				      //var tt=$("#title_type").attr("value","2");
				      	mm = document.getElementById("type_title").value=1;
				     	tt = document.getElementById("title_type").value;
				      	if(mm==1&&tt==1){
				     	$("#title1").show();
				     	$("#title2").hide();
				     	}
				      });
				     $( "#managementInfo:hidden" ).slideDown(function() {
				     	$(".management_add").removeClass("close");$("#base").hide();
				     		mm = document.getElementById("type_title").value;
				     		tt = document.getElementById("title_type").value;
				     		if(mm==1){
				     		mm = document.getElementById("type_title").value=0;
				     		}
				     		$("#title1").hide();
				     		$("#title2").show();
				     });
				     
				 });
	 	}
		);
	 //报价单远
	  $(document).ready(
			function(){
				 $( "#manage" ).click(function() {
				 	 
				     $( "#management:visible" ).slideUp( function (){ $( this ).removeClass("hidden"); $(".manage_add").addClass("close");$("#amount").show();
				     	$(".bid_product_prices").hide();//$("#importuse").hide();导入导出现注掉
				     	
				     	mm = document.getElementById("type_title").value;
				     	tt = document.getElementById("title_type").value=1;
				     	if(mm==1&&tt==1){
					     	$("#title1").show();
					     	$("#title2").hide();
				     	}
				     });
				      $( "#management:hidden" ).slideDown(function() {$(".manage_add").removeClass("close");$("#amount").hide();$(".bid_product_prices").show();
	     					//$("#importuse").show();导入导出现注掉

				     		tt = document.getElementById("title_type").value;
				     		if(tt==1){
				     		tt = document.getElementById("title_type").value=0;
				     		}
				     		$("#title1").hide();
				     		$("#title2").show();
				     });
			//	     $( "#management2:visible" ).slideUp();
//				     $( "#management2:hidden" ).slideDown(function() { $( this ).removeClass("hidden"); });
				     
				 });
	 	}
		);
	 //套件
	 // $( ".complate_add" ).click(function() {
	 // 		var innercode = document.getElementById('innercode').value;
	 //	    winoptn(innercode);
	 //});
	 function complateadd(innercode, aObj){
	     $(aObj).val();
	 	 winopt(innercode,aObj);
	 
	 }
	 //基本信息收缩时的时间
	 (function($) {
    	 function setaRTime(){
     		var times = $( $(".ui-countdown_timer") ).find("dl");
	 					var date = $( times.get(0) ).find("dt").text();
	 					var date2 = $( times.get(0) ).find("dd").text();
	 					
	 					var date3 = $( times.get(1) ).find("dt").text();
	 					var date4 = $( times.get(1) ).find("dd").text();
	 					var date5 = $( times.get(2) ).find("dt").text();
	 					var date6 = $( times.get(2) ).find("dd").text();
	 					var date7 = $( times.get(3) ).find("dt").text();
	 					var date8 = $( times.get(3) ).find("dd").text();
     					$("#base").text("结束时间："+date+date2+" 天 "+date3+date4+"时"+date5+date6+" 分"+date7+date8+"秒 |   采购文件： ");
                     	setTimeout(setaRTime,100);
                 }
                 setaRTime();
  		})($);

  	

	function deleted(){
			$("#imger").hide();
			$("#fujian").hide();
			$(".words").show();
			$("#all_path").attr("value","");
			$("#real_path").attr("value","");
			$("#qafile_name").attr("value","");
			$("#file_size").attr("value","");
			$("#opinion").attr("value","0");
			}
  		
